package struct;

/**
 *
 * @author Gabrielle DuBois
 */
public class History extends DBObject{
    private String mname;
    private String date;
    private String pos;

    /**
     * Constructor for a Family Ministry History Object
     * @param ministryName
     * @param dateOfParticipation
     */
    public History(String ministryName, String dateOfParticipation){
        super(2,2);
        attributes = new Object[numAttributes];
        attributes[0] = mname = ministryName;
        attributes[1] = date = dateOfParticipation;
        
        pos = null;
    }//constructor

    /**
     * Constructor for an Individual Ministry History Object
     * @param ministryName
     * @param dateOfParticipation
     * @param primaryPosition
     */
    public History(String ministryName, String dateOfParticipation,
                        String primaryPosition){
        super(3,2);
        attributes = new Object[numAttributes];
        attributes[0] = mname = ministryName;
        attributes[1] = date = dateOfParticipation;
        attributes[2] = pos = primaryPosition;

    }//constructor

    /**
     * @see struct.DBObject
     * @return an Object array containing all the attributes that make up a
     *          ministry interest for a family or an individual.
     *          For a family the following order is: ministryName(String),
     *          dateOfParticiapation(String).
     *          For an individual the following order is: ministryName(String),
     *          dateOfParticiapation(String), primaryPosition(String)
     */
    public Object[] getAttributes(){
        return attributes;
    }//getAttributes()

    /**
     * @see struct.DBObject
     * @return A String array containing the ministryName in position 0
     *          and then dateOfParticipation in position 1
     */
    public String[] getKey(){
        String[] key = new String[numInPrimaryKey];
        key[0] = mname;
        key[1] = date;
        
        return key;
    }//getKey()

    /**
     *
     * @return a String containing...
     */
    public String getPrimaryPosition(){
        return pos;
    }

}//History